<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>


  <script>
    let arr1 = [2, 3, 4, 63, 6, 2]

    let arr2 = [0, 3, 2, 4, 4, 5, 5, 3, 2, 2,]

    function getNum(arr) {
      let odd = 0
      let average = 0
      for (let i = 0; i < arr.length; i++) {
        if (arr[i] % 2 !== 0) {
          odd += arr[i]
          average = odd / arr.length
        }
      }
      return average
      if (arr[i] % 2 === 0) return 0

    }
    console.log(getNum(arr1));
    console.log(getNum(arr2));
  </script>
</body>

</html>